#include <iostream>
using namespace std;
int main()
{
    int n, now = 0, next, time = 0;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> next;
        if (now - next < 0)
            time += (next - now) * 6 + 5;
        else
            time += (now - next) * 4 + 5;
        now = next;
    }
    cout << time;
}